package com.jiaai.cloud.live.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jiaai.cloud.base.page.CustomPage;
import com.jiaai.cloud.live.entity.TLiveBroadcast;
import com.jiaai.cloud.live.mapper.TLiveBroadcastMapper;
import com.jiaai.cloud.live.service.ITLiveBroadcastService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.jiaai.cloud.live.vo.BroadcastListVO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 直播间 服务实现类
 * </p>
 *
 * @author 佳爱网络科技
 * @since 2017-08-01
 */
@Service
public class TLiveBroadcastServiceImpl extends ServiceImpl<TLiveBroadcastMapper, TLiveBroadcast> implements ITLiveBroadcastService {

    @Override
    public CustomPage<BroadcastListVO> findByBroadcastVo(Page page) {
        page.setRecords(baseMapper.findByBroadcastVo(page));
        return new CustomPage<BroadcastListVO>(page);
    }

    @Override
    public List<TLiveBroadcast> findByAnchorId(String anchorId) {
        return baseMapper.findByAnchorId(anchorId);
    }

    @Override
    public List<Map<String, Object>> selectDataCount() {
        return baseMapper.selectDataCount();
    }
}
